package br.ufrn.labmetrol.view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.border.TitledBorder;
import javax.swing.JButton;

public class CadastrarCelula extends JFrame {

	private JPanel contentPane;
	private JTextField txtIndentificador;
	private JLabel lblCertificado;
	private JLabel lblData;
	private JTextField txtCertificado;
	private JTextField txtData;
	private JPanel panel;
	private JLabel lblA;
	private JLabel lblB;
	private JLabel lblC;
	private JLabel lblD;
	private JTextField txtCteA;
	private JTextField txtCteB;
	private JTextField txtCteC;
	private JTextField txtCteD;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CadastrarCelula frame = new CadastrarCelula();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CadastrarCelula() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 350, 480);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblIdentificador = new JLabel("Identificação:");
		lblIdentificador.setFont(new Font("Dialog", Font.BOLD, 16));
		lblIdentificador.setHorizontalAlignment(SwingConstants.CENTER);
		lblIdentificador.setBounds(17, 12, 122, 26);
		contentPane.add(lblIdentificador);
		
		txtIndentificador = new JTextField();
		txtIndentificador.setText("");
		txtIndentificador.setBounds(157, 13, 179, 26);
		contentPane.add(txtIndentificador);
		txtIndentificador.setColumns(10);
		
		lblCertificado = new JLabel("Certificado de Calibração (Número):");		
		lblCertificado.setFont(new Font("Dialog", Font.BOLD, 16));
		lblCertificado.setHorizontalAlignment(SwingConstants.CENTER);
		lblCertificado.setBounds(17, 50, 319, 26);
		contentPane.add(lblCertificado);
		
		lblData = new JLabel("Data de Calibração:");
		lblData.setFont(new Font("Dialog", Font.BOLD, 16));
		lblData.setHorizontalAlignment(SwingConstants.CENTER);
		lblData.setBounds(17, 126, 319, 26);
		contentPane.add(lblData);
		
		txtCertificado = new JTextField();
		txtCertificado.setHorizontalAlignment(SwingConstants.CENTER);
		txtCertificado.setText("9999-9999");
		txtCertificado.setBounds(17, 88, 319, 26);
		contentPane.add(txtCertificado);
		txtCertificado.setColumns(10);
		
		txtData = new JTextField();
		txtData.setHorizontalAlignment(SwingConstants.CENTER);
		txtData.setText("19/11/13");
		txtData.setBounds(17, 164, 319, 26);
		contentPane.add(txtData);
		txtData.setColumns(10);
		
		panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "Constantes", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(12, 202, 324, 194);
		contentPane.add(panel);
		panel.setLayout(null);
		
		lblA = new JLabel("A:");
		lblA.setFont(new Font("Dialog", Font.BOLD, 16));
		lblA.setHorizontalAlignment(SwingConstants.CENTER);
		lblA.setBounds(22, 22, 32, 25);
		panel.add(lblA);
		
		lblB = new JLabel("B:");
		lblB.setHorizontalAlignment(SwingConstants.CENTER);
		lblB.setFont(new Font("Dialog", Font.BOLD, 16));
		lblB.setBounds(22, 61, 32, 25);
		panel.add(lblB);
		
		lblC = new JLabel("C:");
		lblC.setHorizontalAlignment(SwingConstants.CENTER);
		lblC.setFont(new Font("Dialog", Font.BOLD, 16));
		lblC.setBounds(22, 108, 32, 25);
		panel.add(lblC);
		
		lblD = new JLabel("D:");
		lblD.setHorizontalAlignment(SwingConstants.CENTER);
		lblD.setFont(new Font("Dialog", Font.BOLD, 16));
		lblD.setBounds(22, 147, 32, 25);
		panel.add(lblD);
		
		txtCteA = new JTextField();
		txtCteA.setBounds(72, 22, 240, 25);
		panel.add(txtCteA);
		txtCteA.setColumns(10);
		
		txtCteB = new JTextField();
		txtCteB.setColumns(10);
		txtCteB.setBounds(72, 61, 240, 25);
		panel.add(txtCteB);
		
		txtCteC = new JTextField();
		txtCteC.setColumns(10);
		txtCteC.setBounds(72, 108, 240, 25);
		panel.add(txtCteC);
		
		txtCteD = new JTextField();
		txtCteD.setColumns(10);
		txtCteD.setBounds(72, 147, 240, 25);
		panel.add(txtCteD);
		
		JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.setBounds(219, 408, 117, 25);
		contentPane.add(btnCancelar);
		
		JButton btnCadastrar = new JButton("Cadastrar");
		btnCadastrar.setBounds(90, 408, 117, 25);
		contentPane.add(btnCadastrar);
	}
}
